Fix incorrectly ignored dts file from project reference for resolution#1712
Merged
sheetalkamat merged 2 commits intomainfrom Sep 11, 2025
Merged
Fix incorrectly ignored dts file from project reference for resolution#1712sheetalkamat merged 2 commits intomainfrom
sheetalkamat merged 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where d.ts files from project references were incorrectly ignored during module resolution. The fix ensures that both TypeScript source files and declaration files are properly included when building composite projects with project references.
- Renamed method to include both declaration and source files in the iteration
- Updated logic to process both TypeScript source files and d.ts files appropriately
- Added comprehensive test case covering project reference resolution scenarios
- Improved whitespace handling in test utility function
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/tsoptions/parsedcommandline.go | Updated method name and logic to include both d.ts and source files in project reference resolution |
| internal/compiler/fileloader.go | Updated method call to use the renamed function for project reference file iteration |
| internal/testutil/stringtestutil/stringtestutil.go | Enhanced Dedent function to handle all whitespace characters properly, not just tabs |
| internal/execute/tsctests/tsc_test.go | Added comprehensive test case for project reference resolution from d.ts files |
| testdata/baselines/reference/tsbuild/moduleResolution/resolution-from-d.ts-of-referenced-project.js | Generated test baseline showing expected behavior for the new test case |
jakebailey
approved these changes
Sep 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of microsoft/TypeScript#62438